home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / benchmarks / itc / gcc / specs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-30  |  5.3 KB  |  164 lines

  1. /*
  2.  * specs.h --
  3.  *
  4.  *    This file is included by gcc.c, and defines the compilation
  5.  *    and linking specs for each of the target machines for which
  6.  *    gcc can currently generate code.
  7.  *
  8.  * Copyright 1988 Regents of the University of California
  9.  * Permission to use, copy, modify, and distribute this
  10.  * software and its documentation for any purpose and without
  11.  * fee is hereby granted, provided that the above copyright
  12.  * notice appear in all copies.  The University of California
  13.  * makes no representations about the suitability of this
  14.  * software for any purpose.  It is provided "as is" without
  15.  * express or implied warranty.
  16.  *
  17.  * $Header: specs.h,v 1.11 88/10/02 16:15:04 hilfingr Exp $ SPRITE (Berkeley)
  18.  */
  19.  
  20. #ifndef _SPECS
  21. #define _SPECS
  22.  
  23. /* This structure says how to run one compiler, and when to do so.  */
  24.  
  25. struct compiler
  26. {
  27.   char *suffix;            /* Use this compiler for input files
  28.                    whose names end in this suffix.  */
  29.   char *spec;            /* To use this compiler, pass this spec
  30.                    to do_spec.  */
  31. };
  32.  
  33. /*
  34.  * One of the following structures exists for each machine for
  35.  * which gcc can generate code.  It gives all the spec-related
  36.  * information for compiling for tha target.
  37.  */
  38.  
  39. typedef struct
  40. {
  41.     char *name;                /* Official name of this target
  42.                      * machine (many -m switches may
  43.                      * map to the same entry). */
  44.     struct compiler *base_specs;    /* List of specs to use when compiling
  45.                      * for this target machine.  Last
  46.                      * compiler must be all zeros to
  47.                      * indicate end of list. */
  48.     char *link_base_spec;        /* Basic spec to use to link for this
  49.                      * target. */
  50.     char *cpp_predefines;        /* Spec to substitute for %p. */
  51.     char *compile_spec;            /* Spec to substitute for %C. */
  52.     char *asm_spec;            /* Spec to substitute for %a. */
  53.     char *link_spec;            /* Spec to substitute for %l. */
  54.     char *lib_spec;            /* Spec to substitute for %L. */
  55.     char *startfile_spec;        /* Spec to substitute for %S. */
  56. } target_specs;
  57.  
  58. /*
  59.  * Spec information for individual machines:
  60.  */
  61.  
  62. struct compiler default_compilers[] =
  63. {
  64.     {".c",
  65.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} \
  66.         -I/sprite/lib/include.new/%m.md %{M*} %{T} \
  67.         -undef -D__GNUC__ %{ansi:-T -$ -D__STRICT_ANSI__}\
  68.     %{!ansi:%p -Dunix -Dsprite}\
  69.         %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
  70.     %{Wcomment} %{Wtrigraphs} %{Wall}\
  71.         %i %{!M*:%{!E:%g.cpp}}%{E:%{o*}}%{M*:%{o*}}\n\
  72.      %{!M*:%{!E:%C %g.cpp %{!Q:-quiet} -dumpbase %i %{Y*} %{d*} %{m*} %{f*}\
  73.     %{g} %{O} %{W*} %{w} %{pedantic} %{ansi} %{traditional}\
  74.     %{v:-version} %{gg:-symout %g.sym} %{pg:-p} %{p}\
  75.         %{S:%{o*}%{!o*:-o %b.s}}%{!S:-o %g.s}\n\
  76.      %{!S:%a %{R} %{j} %{J} %{h} %{d2} %{gg:-G %g.sym}\
  77.     %g.s %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\n }}}"},
  78.     {".s",
  79.      "%{!S:%a %{R} %{j} %{J} %{h} %{d2}\
  80.     %i %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o}\n }"},
  81.     /* Mark end of table. */
  82.     {0, 0}
  83. };
  84.  
  85. char default_link_spec[] =
  86.     "%{!c:%{!M*:%{!E:%{!S:%l %{o*}\
  87.     %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  88.     %{y*} %{!nostdlib:%S} %{L*} -L/sprite/lib/%m.md \
  89.     %o %{!nostdlib:%L}\n }}}}";
  90.  
  91.  
  92. target_specs m68000_target =
  93. {
  94.     "sun2",                    /* name */
  95.     default_compilers,                /* base_specs */
  96.     default_link_spec,                /* link_base_spec */
  97.     "-Dmc68000 -Dsun2 %{funsigned-char: -D__CHAR_UNSIGNED__}",
  98.                         /* cpp_predefines */
  99.     "cc1.68k -msoft-float -m68000",        /* compile_spec */
  100.     "as -m68010",                /* asm_spec */
  101.     "ld.new -X %{!e:-e start}",
  102.                         /* link_spec */
  103.     "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}",    /* lib_spec */
  104.     ""                        /* start_file_spec */
  105. };
  106.  
  107. target_specs m68020_target =
  108. {
  109.     "sun3",                    /* name */
  110.     default_compilers,                /* base_specs */
  111.     default_link_spec,                /* link_base_spec */
  112.     "-Dmc68000 -Dsun3 %{funsigned-char: -D__CHAR_UNSIGNED__}",
  113.                         /* cpp_predefines */
  114.     "cc1.68k -msoft-float -m68020",        /* compile_spec */
  115.     "as -m68020",                /* asm_spec */
  116.     "ld.new -X %{!e:-e start}",
  117.                         /* link_spec */
  118.     "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}",    /* lib_spec */
  119.     ""                        /* start_file_spec */
  120. };
  121.  
  122. target_specs spur_target =
  123. {
  124.     "spur",                    /* name */
  125.     default_compilers,                /* base_specs */
  126.     default_link_spec,                /* link_base_spec */
  127.     "-Dspur %{funsigned-char: -D__CHAR_UNSIGNED__}",
  128.                         /* cpp_predefines */
  129.     "cc1.spur -msoft-float",            /* compile_spec */
  130.     "sas",                    /* asm_spec */
  131.     "sld -X -p %{!e:-e start}",            /* link_spec */
  132.     "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}",    /* lib_spec */
  133.     ""                        /* start_file_spec */
  134. };
  135.  
  136. /*
  137.  * Top-level table used to look up information for a particular target
  138.  * machine.  The first entry will be used as the default target if
  139.  * a target isn't specified in a command-line switch or environment
  140.  * variable.
  141.  */
  142.  
  143. typedef struct
  144. {
  145.     char *name;            /* Name of target machine (as it
  146.                  * appears in "-m" switch. */
  147.     target_specs *info;        /* Information about target machine. */
  148. } target_machine;
  149.  
  150. target_machine target_machines[] = {
  151.     {"sun3",    &m68020_target},    /* This is the default target. */
  152.     {"68000",    &m68000_target},
  153.     {"68010",    &m68000_target},
  154.     {"sun2",    &m68000_target},
  155.     {"68020",    &m68020_target},
  156.     {"spur",    &spur_target},
  157.     {0, 0}                /* Zeroes mark end of list. */
  158. };
  159.  
  160. char *target_name;            /* Name of selected target. */
  161. target_specs *target;            /* Info for selected target. */
  162.  
  163. #endif _SPECS
  164.